package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.controller.request.PropsReleasedRequest;
import com.sc.nft.entity.vo.UserPropsRewardsDetailVO;
import com.sc.nft.pool.UserPool;
import com.sc.nft.service.MallUserPropsRewardsDetailService;
import com.sc.nft.sup.PageRequest;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/mallUserPropsRewardsDetail")
@Api(tags = "道具奖励记录模块")
public class MallUserPropsRewardsDetailController {

    private final MallUserPropsRewardsDetailService mallUserPropsRewardsDetailService;

    @PostMapping("/page")
    @ApiOperation("分页查询用户道具奖励明细记录")
    @UserLogin
    public PageResult<UserPropsRewardsDetailVO> page(@RequestBody PropsReleasedRequest request) {
        return PageResult.success(mallUserPropsRewardsDetailService.page(request.getDaoId(), UserPool.getUser(),
                request.toMp()));
    }
}
